package sensorLAN.UIServidor;

//import java.awt.event.ActionEvent;
//import java.awt.event.ActionListener;

import javax.swing.event.DocumentEvent;
import javax.swing.event.DocumentListener;

public class PanelSuperiorConEventos extends PanelSuperior {

	/**
	 * 
	 */
	private static final long serialVersionUID = -7351465310140557706L;
	private Principal principal;

	public PanelSuperiorConEventos(Principal principal) {
		super();
		this.principal= principal;
	}
	
	@Override
	protected void manejarEventos() {
		/*
		guardar.addActionListener(new ActionListener(){
			@Override
			public void actionPerformed(ActionEvent ae) {
				principal.guardarTabla();		
			}		
		});
		*/
		this.getFiltro().getDocument().addDocumentListener(
                new DocumentListener() {
                    public void changedUpdate(DocumentEvent e) {
                    	principal.nuevoFiltro(getFiltro().getText());
                    }
                    public void insertUpdate(DocumentEvent e) {
                    	principal.nuevoFiltro(getFiltro().getText());
                    }
                    public void removeUpdate(DocumentEvent e) {
                    	principal.nuevoFiltro(getFiltro().getText());
                    }
                });
	}
}
